package service;

import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import vo.DonationVO;
import vo.MemberVO;
import vo.OrganizationVO;
import dao.DonationDao;

@Service
public class DonationServiceImpl implements DonationService {
	@Resource(name = "donationDaoImpl")
	private DonationDao donationDao;

	@Override
	public HashMap organization(MemberVO mvo) {
		System.out.println("service organization");
		
		List<OrganizationVO> oAry = donationDao.getOrganization(mvo);
		
		HashMap map = new HashMap();
		map.put("organizationlist", oAry);
		
		
		
		System.out.println("service redbeanMember");
		MemberVO member = donationDao.getMember(mvo);
		map.put("memberredbean", member);
		
		System.out.println(map);
		
		return map;
	}

	@Override
	public OrganizationVO donationDetail(int ono) {
		
		return donationDao.getDonationDetail(ono);
	}

	@Override
	public List<DonationVO> donationlist(MemberVO mvo) {
		
		return donationDao.getDonationList(mvo);
	}

	@Override
	public MemberVO updateDonation(MemberVO vo) {
		donationDao.updateDonation(vo);
		return donationDao.selectMReadbean(vo.getMid());
	}

	@Override
	public int updateOrganization(MemberVO vo) {
		
		return donationDao.updateOrganization(vo);
	}

}
